#ifndef TCPSERVER_H
#define TCPSERVER_H

#include <boost/asio.hpp>
#include <boost/array.hpp>
#include <iostream>
#include <list>
#include "TCPConnection.h"
#include "database/Client.hpp"
#include "database/DatabaseManager.h"

class TCPServer
{
 public:
  TCPServer(boost::asio::io_service& ioService, int port);
  void startAccept();
  DatabaseManager &getDB() { return _dbManager; }
 private:
  void handleAccept(TCPConnection::pointer newConnection,
		     const boost::system::error_code& error);
  boost::asio::ip::tcp::acceptor _acceptor;
  DatabaseManager _dbManager;
};

#endif
